/*    */ package com.lmpop.createIndex.search;
/*    */ 
/*    */ import com.lmpop.createIndex.searchModel.Queue;
/*    */ import com.lmpop.createIndex.searchModel.QueueValue;
/*    */ import com.lmpop.createIndex.searchModel.SearchData;
/*    */ import com.lmpop.createIndex.searchModel.SearchModel;
/*    */ import java.io.IOException;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ public class ProductIndexFiles
/*    */ {
/*    */   public ProperUtil properUtil;
/*    */   private String file_path;
/*    */ 
/*    */   public ProductIndexFiles()
/*    */   {
/* 20 */     this.properUtil = new ProperUtil();
/* 21 */     this.file_path = this.properUtil.getFilePathByModel("product");
/*    */   }
/*    */ 
/*    */   public List getProductList(Map paraMap) throws IOException
/*    */   {
/* 26 */     ArrayList productList = new ArrayList();
/* 27 */     SearchData search = new SearchData();
/* 28 */     ArrayList paraList = new ArrayList();
/*    */ 
/* 30 */     String class_attr = ""; String publish_date = ""; String area_attr = ""; String cat_id = "";
/* 31 */     String state_code = ""; String f = ""; String e = ""; String c = ""; String d = ""; String title = "";
/* 32 */     String order_by = "edit_date";
/* 33 */     if (paraMap.get("class_attr") != null) class_attr = paraMap.get("class_attr").toString();
/* 34 */     if (paraMap.get("order_by") != null) order_by = paraMap.get("order_by").toString();
/* 35 */     if (paraMap.get("title") != null) title = paraMap.get("title").toString();
/* 36 */     if (paraMap.get("cat_id") != null) cat_id = paraMap.get("cat_id").toString();
/*    */ 
/* 38 */     if (paraMap.get("state_code") != null) state_code = paraMap.get("state_code").toString();
/* 39 */     if (paraMap.get("area_attr") != null) area_attr = paraMap.get("area_attr").toString();
/* 40 */     if (paraMap.get("f") != null) f = paraMap.get("f").toString();
/* 41 */     if (paraMap.get("e") != null) e = paraMap.get("e").toString();
/* 42 */     if (paraMap.get("c") != null) c = paraMap.get("c").toString();
/* 43 */     if (paraMap.get("d") != null) d = paraMap.get("d").toString();
/* 44 */     if (paraMap.get("publish_date") != null) publish_date = paraMap.get("publish_date").toString();
/*    */ 
/* 46 */     publish_date = publish_date.replace("-", "") + "000000";
/*    */ 
/* 48 */     Queue queue = new Queue(new QueueValue[] { new QueueValue(order_by, 2, false) });
/* 49 */     paraList.add(new SearchModel("0", "class_attr", class_attr));
/* 50 */     paraList.add(new SearchModel("0", "cat_id", cat_id));
/*    */ 
/* 52 */     paraList.add(new SearchModel("0", "state_code", state_code));
/* 53 */     paraList.add(new SearchModel("0", "area_attr", area_attr));
/* 54 */     paraList.add(new SearchModel("0", "f", f));
/* 55 */     paraList.add(new SearchModel("0", "e", e));
/* 56 */     paraList.add(new SearchModel("0", "c", c));
/* 57 */     paraList.add(new SearchModel("0", "d", d));
/* 58 */     paraList.add(new SearchModel("1", "publish_date", publish_date));
/* 59 */     paraList.add(new SearchModel("0", "title", title));
/* 60 */     productList = search.getSearchInfo(this.file_path, paraList, queue);
/* 61 */     return productList;
/*    */   }
/*    */ 
/*    */   public ArrayList getProductInfo(String cat_id, String area_code, String keyword, String state_code, String search_date)
/*    */     throws IOException
/*    */   {
/* 68 */     ArrayList showList = new ArrayList();
/* 69 */     SearchData search = new SearchData();
/* 70 */     ArrayList paraList = new ArrayList();
/*    */ 
/* 72 */     Queue queue = new Queue(new QueueValue[] { new QueueValue("state_code", 2, true), new QueueValue("product_id", 2, true) });
/* 73 */     paraList.add(new SearchModel("0", "class_attr", cat_id));
/* 74 */     paraList.add(new SearchModel("0", "area_attr", area_code));
/* 75 */     paraList.add(new SearchModel("1", "publish_date", search_date));
/* 76 */     paraList.add(new SearchModel("2", keyword, new String[] { "product_name", "product_desc" }));
/* 77 */     showList = search.getSearchInfo(this.file_path, paraList, queue);
/* 78 */     return showList;
/*    */   }
/*    */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.createIndex.search.ProductIndexFiles
 * JD-Core Version:    0.6.0
 */